//
//  WXDetailCollectionViewCell.m
//  Big Show
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 Big_Q. All rights reserved.
//

#import "WXDetailCollectionViewCell.h"


@interface WXDetailCollectionViewCell ()
// 发现详情下的引导语
@property (nonatomic, retain) UILabel *label;
// 两张图片
@property (nonatomic, retain) UIImageView *image1;
@property (nonatomic, retain) UIImageView *image2;
@end
@implementation WXDetailCollectionViewCell

// 初始化创建空间
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 引导语
        self.label = [[UILabel alloc] init];
        _label.backgroundColor = [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1];
        [self.contentView addSubview:_label];
        [_label release];
        // 图片1
        self.image1 = [[UIImageView alloc] init];
        _image1.backgroundColor = [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1];
        [self.contentView addSubview:_image1];
        [_image1 release];
        // 图片2
        self.image2 = [[UIImageView alloc] init];
        _image2.backgroundColor = [UIColor colorWithRed:arc4random()%256/255.0 green:arc4random()%256/255.0 blue:arc4random()%256/255.0 alpha:1];
        [self.contentView addSubview:_image2];
        [_image2 release];
    }
    return self;
}

//// 布局信息
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _label.frame = CGRectMake(10, 10, self.contentView.bounds.size.width-20, 40);
    _image1.frame = CGRectMake(10, 65, 160, 100);
    _image2.frame = CGRectMake(190, 65, 160, 100);
}

//// model对象的setter方法
-(void)setDetailModel:(WXDetailModel *)detailModel
{
    if (_detailModel != detailModel) {
        [_detailModel release];
        _detailModel = [detailModel retain];
    }
}

@end
